package tournament.volleyball;

public class PoolRivalry extends Rivalry{
	
	PoolRivalry(Team team1, Team team2){
		super(team1, team2);
		int gamesPerSet = 2;
		
		initialize(gamesPerSet);
	}
	
	public int getPointsScored(Team team) {
		int pointsScored = 0;
		
		for (int i=0; i<games.size(); i++) {
			pointsScored += games.get(i).getScore(team);
		}
		
		return pointsScored;
	}
	
	public int getPointsAllowed(Team team) {
		int pointsAllowed = 0;
		
		Team opponent = getOpponent(team);
		
		if (opponent != null){
			for (int i=0; i<games.size(); i++) {
				pointsAllowed += games.get(i).getScore(opponent);
			}
		}
		
		return pointsAllowed;
	}
}
